package table.cellrenderer;

import java.awt.Color;

import javax.swing.table.DefaultTableCellRenderer;


public class BetragTableCellRenderer extends DefaultTableCellRenderer {

    private static final long serialVersionUID = 100L;


    @Override
    public void setValue(Object value) {
        Double betrag = (Double) value;
        setText(betrag.toString());
        setForeground(betrag.doubleValue() < 0 ? Color.RED
                                               : Color.BLACK);
    }
}
